home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DBio / DSeqEd.h < prev    next >
Text File  |  1996-07-05  |  3KB  |  107 lines

  1. // DSeqEd.h
  2. // d.g.gilbert
  3.  
  4.  
  5. #include <DWindow.h>
  6. #include <DDialogText.h>
  7. #include <DUtil.h>
  8. #include <ncbi.h>
  9.  
  10. class DSequence;
  11. class DSeqedView;
  12. class DSeqDoc;
  13. //class DSeqIndex;
  14. //class    DSeqHIndex;
  15. class DPopupList;
  16. class DPrompt;
  17. class DButton;
  18. class DEditText;
  19.  
  20.  
  21. class DSeqedWindow : public DWindow
  22. {
  23. public:
  24.     enum { kId= 23242 };
  25.     
  26.     DSequence        * fSequence; // seq we are editing
  27.     DSeqedView    * fSeqedView; 
  28.     DEditText        * fSeqName;
  29.     DPrompt         * fSeqCheck, *fSeqStart, *fSeqEnd, *fSeqLen, *fSeqSel, *fSeqTyp;
  30.     DPopupList    * fCodePop; //dna/rna/iupac/amino/all
  31.     DSeqDoc            *    fMainDoc;
  32.  
  33.     DSeqedWindow(long id, DTaskMaster* itsSuperior, DSeqDoc* itsSeqDoc, DSequence* aSeq,
  34.             short winwidth = -5, short winheight = -5, short winleft = -50, short wintop = -20, 
  35.             char* title = NULL);
  36.     virtual ~DSeqedWindow();
  37.     
  38.     static void  UpdateEdWinds( DSequence* oldSeq, DSequence* newSeq);
  39.     virtual void ReplaceSeq(DSequence* aSeq);
  40.     virtual void UpdateEdits(); 
  41.     virtual Nlm_Boolean IsMyAction(DTaskMaster* action);
  42.     virtual void Close();
  43. };
  44.  
  45.         
  46.  
  47. class DSeqedView : public DDialogScrollText, public DKeyCallback
  48. {
  49. public:
  50.     long            fOldStart, fOldEnd, fOldLen;  //save selStart,End for redraw check
  51.     short            fOldKind;
  52.     unsigned long fOldCheck;
  53.     Nlm_RecT    fOldDest, fOldView;         //save Dest Rect for SeqIndex redraw check
  54.     DSequence    * fSequence;
  55.     DPrompt     * fSeqCheck, *fSeqStart, *fSeqEnd, *fSeqLen, *fSeqSel, *fSeqTyp;
  56.     DPopupList    * fCodePop; //dna/rna/iupac/amino/all
  57.     Boolean    fChanged;             //flag if any edits in view
  58.     DSeqedWindow    * fDoc;
  59.     //DSeqIndex        * fSeqIndex;
  60.     //DSeqHIndex    * fSeqHIndex;
  61.     
  62.     DSeqedView(long id, DView* itsSuperior, DSeqedWindow* itsDoc, DSequence* aSeq, 
  63.                             short width = 30, short height = 10);
  64.     virtual ~DSeqedView();
  65.     
  66.     virtual void UpdateCtls(Boolean forceIndex);  //call this when seq indices change
  67.     virtual void SetSeq(DSequence* aSeq); 
  68.     
  69.         //! Override some TEView methods to call UpdateCtls 
  70.     virtual void selectAction();
  71.     virtual void deselectAction();
  72.  
  73.   virtual void ProcessKey( char c);
  74.  
  75.     virtual Boolean DoMenuTask(long tasknum, DTask* theTask);
  76.     virtual Boolean IsMyAction(DTaskMaster* action); 
  77.         
  78.         //keep cursor at arrow when teview is not selected (inactive "edittext");
  79.     //virtual void DoSetCursor(VPoint localPoint, RgnHandle cursorRegion);    // override 
  80.             
  81.         //use to select this view for editing in DLog environment 
  82.     //virtual Boolean HandleMouseDown( VPoint theMouse, TToolboxEvent event, hysteresis: Point); // override 
  83.  
  84. };
  85.  
  86.  
  87.  
  88. enum { kSeqDocPrefInit, kSeqDocPrefDialog };
  89. extern Nlm_FonT  gSeqFont;
  90.  
  91. void SeqDocPrefs(short id);
  92.  
  93.  
  94. #if 0
  95.     TSeqIndex            == OBJECT (TControl);
  96.         fTEView    : TTEView; 
  97.         virtual void TSeqIndex::Initialize(void); // override 
  98.         virtual void TSeqIndex::CalcMinFrame(VRect VAR minFrame); // override 
  99.         virtual void TSeqIndex::Draw(VRect area); // override 
  100.         }
  101.         
  102.     TSeqHIndex            == OBJECT (TControl);
  103.         fTEView    : TTEView;
  104.         virtual void TSeqHIndex::Draw(VRect area); // override 
  105.         }
  106. #endif
  107.